package com.gugee.tiktok.data.web.controller;

import com.gugee.tiktok.data.web.service.BloggersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 播主
 */
@RestController
@Api(value = "播主",tags = {"播主"})
public class BloggerController {

    /**
     * 服务
     */
    @Autowired
    BloggersService bloggersService;

    /**
     * 更新播主信息
     * @param bloggerId
     * @param region
     * @param bloggerType
     * @return
     */
    @ApiOperation(value = "更新播主信息",notes = "向kafka队列中插入更新播主请求")
    @GetMapping(value = "blogger", produces = "application/json;charset=UTF-8")
    public Boolean updateBlogger(@RequestParam Long bloggerId,@RequestParam String region,@RequestParam String bloggerType){
        if(bloggerId == null){
            return false;
        }
        return bloggersService.sendBloggerMsg(bloggerId,region,bloggerType);
    }
}
